package com.twu.excercise;

import java.util.Scanner;

public class Triangle {
    public static void main(String[] args) {
        printAsterisks(1);
        printNewLine();

        int n = readNumber();
        printAsterisks(n);
        printNewLine();

        n=readNumber();
        printVerticalLine(n);

        n= readNumber();
        printTriangle(n);



    }

    public static void printTriangle(int n) {
        for(int i=1;i<=n;i++) {
            printAsterisks(i);
            printNewLine();
        }
    }

    private static void printVerticalLine(int n) {
        for(int i=0;i<n;i++) {
            printAsterisks(1);
            printNewLine();
        }
    }

    public static int readNumber() {
        Scanner scanner =new Scanner(System.in);
        System.out.println("Enter the number");
        return scanner.nextInt();
    }

    public static void printAsterisks(int n) {
        for(int i=0;i<n;i++)
            System.out.print("*");
    }

    public static void printNewLine() {
        System.out.println("");
    }
}
